package com.neusoft.oa.serviceImp;

import com.neusoft.oa.mapper.InboxMapper;
import com.neusoft.oa.pojo.Email;
import com.neusoft.oa.pojo.Inbox;
import com.neusoft.oa.service.IInboxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class InboxServiceImp implements IInboxService {

    @Autowired
    InboxMapper inboxMapper;


    public List<Email> inboxList(Email email) {
        return inboxMapper.inboxList(email);
    }

    @Override
    public List<Email> signList(Email email) {
        return inboxMapper.signList(email);
    }

    @Override
    public List<Email> deleteList(Email email) {
        return inboxMapper.deleteList(email);
    }

    @Override
    public boolean inboxDelete(int id) {
        int n=inboxMapper.inboxDelete(id);
        if(n>0)
            return true;
        return false;
    }

    @Override
    public boolean emailsDelete(int []emails) {
        int n=inboxMapper.emailsDelete(emails);
        if(n>0)
            return true;
        return false;
    }



    @Override
    public boolean inboxSign(int id) {
        int n=inboxMapper.inboxSign(id);
        if(n>0)
            return true;
        return false;

    }

    @Override
    public boolean cancelSign(int id) {
        int n=inboxMapper.cancelSign(id);
        if(n>0)
            return true;
        return false;
    }

    @Override
    public boolean cancelDelete(int id) {
        int n=inboxMapper.cancelDelete(id);
        if(n>0)
            return true;
        return false;
    }
}
